<?php 
	$objConver  			= new HT_Model_administrator_models_convert();
	$objUtil  				= new HT_Model_administrator_models_utility();
	$categoryNews 			= $this->categoryNews;
	$hotNews 				= $categoryNews['hotNews'];
	$topNews				= $categoryNews['topNews'];
	
	$category				= $categoryNews['category'];
	$cateName				= stripslashes($category['category_name']);
	
	$bigNews				= @$hotNews[0];
	$bigNewsTitle 			= $bigNews['title'];
	$bigNewsPath 			= ROOT_PATH."/public/uploads/news/".$bigNews['image'];
	$bigNewsImageUrl		= null;
	if(is_file($bigNewsPath)){
		$bigNewsImageUrl	= WEB_PATH."/public/uploads/news/".$bigNews['image'];
	}
	$bigNewsDescription 	= $objUtil->tooltipString(trim(stripcslashes($bigNews['description'])),200);
	$bigNewsUrl				= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($bigNewsTitle).'-'.$bigNews['news_id'].'.html';
?>
<div class="column1 fl">
	<div class="c1_box1">
		<div class="hot_news fl">
			<?php if($bigNewsImageUrl){?>
			<div class="hot_news_image"><img alt="" src="<?php echo $bigNewsImageUrl?>"></div>
			<?php }?>
			<div class="hot_news_title"><a href="<?php echo $bigNewsUrl;?>"><?php echo $bigNewsTitle;?></a></div>
			<div class="hot_news_description"><?php echo $bigNewsDescription;?></div>
		</div>
		<div class="hot_news_list fl">
			<div class="hot_news_list_header"><h1><?php echo $cateName;?><h1></div>
			<?php 
				for($i=1;$i<4;$i++){
					$news 				= @$hotNews[$i];
					$newsTitle 			= stripcslashes($news['title']);
					$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
					$newsImageUrl		= null;
					if(is_file($newsPath)){
						$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
					}
					$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
					$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
			?>
			<div class="hot_item">
				<?php if($newsImageUrl){?>
				<div class="hot_item_image fl"><img src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a>
				<br>
				<?php echo $newsDescription;?>
			</div>
			<div class="cb"></div>
			<?php }?>
		</div>
		<div class="cb"></div>
	</div>
	<div class="c1_box2">
		<?php 
			for($i=4;$i<8;$i++){
				$news 				= @$hotNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
		?>
		<div class="cb2_item fl">
			<?php if($newsImageUrl){?>
			<div class="cb2_image"><img src="<?php echo $newsImageUrl;?>"></div>
			<?php }?>
			<div class="cb2_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
		</div>
		<?php }?>
		<div class="cb"></div>
	</div>
	<?php 
		$totalNews = sizeof($hotNews) - 9;
		if($totalNews >0){
	?>
	<div class="c1_box3">
		<div class="yb_header">
			<div class="ybh_1 fl"></div>
			<div class="ybh_subject fl">Những tin khác</div>
			<div class="ybh_3 fl"></div>
			<div class="ybh_item fl"></div>
			<div class="cb"></div>
		</div>
		<?php 
			for($i=9;$i<sizeof($hotNews);$i++){
				$news 				= @$hotNews[$i];
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),100);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
				if($i %2 == 0){
					$newsBox = 'news_box1';
				}else{
					$newsBox = 'news_box2';
				}
				
		?>
		<div class="<?php echo $newsBox;?> fl">
			<div class="news_title"><a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a></div>
			<div class="news_info">
				<?php if($newsImageUrl){?>
				<div class="news_image1 fl"><img alt="" src="<?php echo $newsImageUrl;?>"></div>
				<?php }?>
				<?php echo $newsDescription;?>
				<div class="cb"></div>
			</div>
		</div>
		<?php 
				if($i %2 == 1 && $i != $totalNews - 1){
					echo '<div class="cb"></div><div class="news_line"></div>';
				}elseif($i %2 == 1){
					echo '<div class="cb"></div>';
				}elseif($totalNews %2 == 1 && $i == $totalNews - 1){
					echo '<div class="cb"></div>';
				}
			}
		?>
	</div>
	<div class="cb"></div>
	<?php }?>
</div>
<div class="column2 fl">
	<?php echo $this->action('rightadv4','elements','front');?>
	<?php echo $this->action('rightadv1','elements','front');?>
	<div class="top_news_list">
		<div class="hot_news_list_header">Những bài được xem nhiều nhất</div>
		<?php 
			foreach((array)$topNews as $news){
				$newsTitle 			= stripcslashes($news['title']);
				$newsPath 			= ROOT_PATH."/public/uploads/news/".$news['image'];
				$newsImageUrl		= null;
				if(is_file($newsPath)){
					$newsImageUrl	= WEB_PATH."/public/uploads/news/".$news['image'];
				}
				$newsDescription 	= $objUtil->tooltipString(trim(stripcslashes($news['description'])),70);
				$newsUrl			= WEB_PATH.'/chi-tiet/'.$objConver->utf8_to_url($newsTitle).'-'.$news['news_id'].'.html';
		?>
		<div class="top_item_info">
			<?php if($newsImageUrl) echo '<div class="top_item_image fl"><img alt="" src="'.$newsImageUrl.'"></div>'; ?>
			<a alt="<?php echo $newsTitle;?>" title="<?php echo $newsTitle;?>" href="<?php echo $newsUrl;?>"><?php echo $newsTitle;?></a>
			<p><?php echo $newsDescription;?></p>
			<div class="cb"></div>
		</div>
		<div class="cb"></div>
		<?php } ?>
	</div>
	<?php //echo $this->action('rightadv2','elements','front');?>
</div>
<div class="cb"></div>
